/*
 * ExtFileNameFilter.java
 *
 * Created on February 23, 2006, 8:51 PM
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
package custom.io;

import java.io.File;
import java.io.FilenameFilter;

/**
 *
 * @author David Armstrong
 */
public class ExtFileNameFilter implements FilenameFilter {

    private String ext = null;

    /** Creates a new instance of ExtFileNameFilter */
    public ExtFileNameFilter(String ext) {
        this.ext = ext;
    }

    public boolean accept(File directory, String fileName) {
        boolean status = true;
        if (ext != null) {
            status = fileName.endsWith(ext);
        }
        return status;
    }
}
